﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
using System.IO;
using CrystalDecisions.CrystalReports.Engine;   
using CrystalDecisions.Shared;  


namespace community
{
    public partial class crysprint : Form
    {
        public crysprint(Form f )
        {
            InitializeComponent();
        }

        private void crysprint_Load(object sender, EventArgs e)
        {
            
             string strSql = " select * from t_view_allergic where inhabitantcode_chr='" + residentcode .rescode  + "'";
             allrep cr = new allrep();
              DataSet ds=new DataSet();  
	          SqlConnection conn=new SqlConnection(SQL .conStr ); 
                conn.Open();
                SqlDataAdapter dap = new SqlDataAdapter(strSql, conn);
                try
                {

                    dap.Fill(ds, "t_view_allergic");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
	            cr.SetDataSource(ds.Tables[0]);
                this. allergicreport.ReportSource = cr;
                conn.Close();
             
              
    
             
        }
    }
}
